package com.pig.controller.goods;

import com.alibaba.dubbo.config.annotation.Reference;
import com.pig.pojo.goods.Category;
import com.pig.service.goods.CategoryService;
import com.pig.util.SysResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cate/")
public class CategoryController {
    @Reference()
    private CategoryService categoryService;

    @RequestMapping("doFindAllCategory")
    public SysResult doFindAllCategory() {
        List<Category> allCategory = categoryService.findAllCategory();
        return SysResult.success(allCategory);
    }
}
